#pragma once
// MESSAGE ATTITUDE_BODY PACKING

#define MAVLINK_MSG_ID_ATTITUDE_BODY 12

MAVPACKED(
typedef struct __mavlink_attitude_body_t {
 uint64_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
 float roll; /*< [rad] Roll angle (-pi..+pi)*/
 float pitch; /*< [rad] Pitch angle (-pi..+pi)*/
 float yaw; /*< [rad] Yaw angle (-pi..+pi)*/
 float roll_speed; /*< [rad/s] Roll angular speed*/
 float pitch_speed; /*< [rad/s] Pitch angular speed*/
 float yaw_speed; /*< [rad/s] Yaw angular speed*/
 float roll_observed; /*< [deg] Roll observed value (-180..180)*/
 float pitch_observed; /*< [deg] Pitch observed value (-90..90)*/
 float yaw_observed_mag; /*< [deg] Yaw observed value (-180..180)*/
 float yaw_observed_rtk; /*< [deg] Yaw observed value (-180..180)*/
 float roll_obs_sub_pred; /*< [deg]  Error between roll angle observed value and prediction value (-180..180)*/
 float pitch_obs_sub_pred; /*< [deg] Error between pitch angle observed value and prediction value (-90..90)*/
 float yaw_obs_sub_pred; /*< [deg]  Error between yaw angle observed value and prediction value (-180..180)*/
 float gyro_x_bia; /*< [deg] X axis gyroscope bias value in body frame (-180..180)*/
 float gyro_y_bia; /*< [deg] Y axis gyroscope bias value in body frame (-180..180)*/
 float gyro_z_bia; /*< [deg] Z axis gyroscope bias value in body frame (-180..180)*/
 float ba_x; /*< [deg/s/s] x axis acceleration value in body frame (-180..180)*/
 float ba_y; /*< [deg/s/s] y axis acceleration value in body frame (-180..180)*/
 float ba_z; /*< [deg/s/s] z axis acceleration value in body frame (-180..180)*/
 float ba_x_obs; /*< [deg/s/s] x axis acceleration observe value in body frame (-180..180)*/
 float ba_y_obs; /*< [deg/s/s] y axis acceleration observe value in body frame (-180..180)*/
 float ba_z_obs; /*< [deg/s/s] z axis acceleration observe value in body frame (-180..180)*/
 float ba_x_bia; /*< [deg/s/s] X axis acceleration bias value in body frame (-30..30)*/
 float ba_y_bia; /*< [deg/s/s] Y axis acceleration bias value in body frame (-30..30)*/
 float ba_z_bia; /*< [deg/s/s] Z axis acceleration bias value in body frame (-30..30)*/
 float bm_x; /*< [mgauss] x axis mgauss value in body frame (-1000..1000)*/
 float bm_y; /*< [mgauss] y axis mgauss value in body frame (-1000..1000)*/
 float bm_z; /*< [mgauss] z axis mgauss value in body frame (-1000..1000)*/
 float bm_x_obs; /*< [mgauss] x axis mgauss observe value in body frame (-1000..1000)*/
 float bm_y_obs; /*< [mgauss] y axis mgauss observe value in body frame (-1000..1000)*/
 float bm_z_obs; /*< [mgauss] z axis mgauss observe value in body frame (-1000..1000)*/
 float bm_x_bia; /*< [mgauss] X axis magnetometer bias value in body frame (-1000..1000)*/
 float bm_y_bia; /*< [mgauss] Y axis magnetometer bias value in body frame (-1000..1000)*/
 float bm_z_bia; /*< [mgauss] Z axis magnetometer bias value in body frame (-1000..1000)*/
 uint32_t time_used; /*<  fusion time*/
 float reserve1; /*<  reserve1*/
 float reserve2; /*<  reserve2*/
 float reserve3; /*<  reserve3*/
 float reserve4; /*<  reserve4*/
 float reserve5; /*<  reserve5*/
 float reserve6; /*<  reserve6*/
 float reserve7; /*<  reserve7*/
 float reserve8; /*<  reserve8*/
 float reserve9; /*<  reserve9*/
 uint8_t static_flag; /*<  Flag of body state. 0:body is moving 1:body is static*/
}) mavlink_attitude_body_t;

#define MAVLINK_MSG_ID_ATTITUDE_BODY_LEN 185
#define MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN 185
#define MAVLINK_MSG_ID_12_LEN 185
#define MAVLINK_MSG_ID_12_MIN_LEN 185

#define MAVLINK_MSG_ID_ATTITUDE_BODY_CRC 105
#define MAVLINK_MSG_ID_12_CRC 105



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_ATTITUDE_BODY { \
    12, \
    "ATTITUDE_BODY", \
    46, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_body_t, time_boot_ms) }, \
         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_body_t, roll) }, \
         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_body_t, pitch) }, \
         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_body_t, yaw) }, \
         { "roll_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_body_t, roll_speed) }, \
         { "pitch_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_body_t, pitch_speed) }, \
         { "yaw_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_body_t, yaw_speed) }, \
         { "roll_observed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_body_t, roll_observed) }, \
         { "pitch_observed", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_attitude_body_t, pitch_observed) }, \
         { "yaw_observed_mag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_attitude_body_t, yaw_observed_mag) }, \
         { "yaw_observed_rtk", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_attitude_body_t, yaw_observed_rtk) }, \
         { "roll_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_attitude_body_t, roll_obs_sub_pred) }, \
         { "pitch_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_attitude_body_t, pitch_obs_sub_pred) }, \
         { "yaw_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_attitude_body_t, yaw_obs_sub_pred) }, \
         { "gyro_x_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_attitude_body_t, gyro_x_bia) }, \
         { "gyro_y_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_attitude_body_t, gyro_y_bia) }, \
         { "gyro_z_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_attitude_body_t, gyro_z_bia) }, \
         { "ba_x", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_attitude_body_t, ba_x) }, \
         { "ba_y", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_attitude_body_t, ba_y) }, \
         { "ba_z", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_attitude_body_t, ba_z) }, \
         { "ba_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_attitude_body_t, ba_x_obs) }, \
         { "ba_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_attitude_body_t, ba_y_obs) }, \
         { "ba_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_attitude_body_t, ba_z_obs) }, \
         { "ba_x_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_attitude_body_t, ba_x_bia) }, \
         { "ba_y_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 100, offsetof(mavlink_attitude_body_t, ba_y_bia) }, \
         { "ba_z_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 104, offsetof(mavlink_attitude_body_t, ba_z_bia) }, \
         { "bm_x", NULL, MAVLINK_TYPE_FLOAT, 0, 108, offsetof(mavlink_attitude_body_t, bm_x) }, \
         { "bm_y", NULL, MAVLINK_TYPE_FLOAT, 0, 112, offsetof(mavlink_attitude_body_t, bm_y) }, \
         { "bm_z", NULL, MAVLINK_TYPE_FLOAT, 0, 116, offsetof(mavlink_attitude_body_t, bm_z) }, \
         { "bm_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 120, offsetof(mavlink_attitude_body_t, bm_x_obs) }, \
         { "bm_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 124, offsetof(mavlink_attitude_body_t, bm_y_obs) }, \
         { "bm_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 128, offsetof(mavlink_attitude_body_t, bm_z_obs) }, \
         { "bm_x_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 132, offsetof(mavlink_attitude_body_t, bm_x_bia) }, \
         { "bm_y_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 136, offsetof(mavlink_attitude_body_t, bm_y_bia) }, \
         { "bm_z_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 140, offsetof(mavlink_attitude_body_t, bm_z_bia) }, \
         { "time_used", NULL, MAVLINK_TYPE_UINT32_T, 0, 144, offsetof(mavlink_attitude_body_t, time_used) }, \
         { "static_flag", NULL, MAVLINK_TYPE_UINT8_T, 0, 184, offsetof(mavlink_attitude_body_t, static_flag) }, \
         { "reserve1", NULL, MAVLINK_TYPE_FLOAT, 0, 148, offsetof(mavlink_attitude_body_t, reserve1) }, \
         { "reserve2", NULL, MAVLINK_TYPE_FLOAT, 0, 152, offsetof(mavlink_attitude_body_t, reserve2) }, \
         { "reserve3", NULL, MAVLINK_TYPE_FLOAT, 0, 156, offsetof(mavlink_attitude_body_t, reserve3) }, \
         { "reserve4", NULL, MAVLINK_TYPE_FLOAT, 0, 160, offsetof(mavlink_attitude_body_t, reserve4) }, \
         { "reserve5", NULL, MAVLINK_TYPE_FLOAT, 0, 164, offsetof(mavlink_attitude_body_t, reserve5) }, \
         { "reserve6", NULL, MAVLINK_TYPE_FLOAT, 0, 168, offsetof(mavlink_attitude_body_t, reserve6) }, \
         { "reserve7", NULL, MAVLINK_TYPE_FLOAT, 0, 172, offsetof(mavlink_attitude_body_t, reserve7) }, \
         { "reserve8", NULL, MAVLINK_TYPE_FLOAT, 0, 176, offsetof(mavlink_attitude_body_t, reserve8) }, \
         { "reserve9", NULL, MAVLINK_TYPE_FLOAT, 0, 180, offsetof(mavlink_attitude_body_t, reserve9) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_ATTITUDE_BODY { \
    "ATTITUDE_BODY", \
    46, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_attitude_body_t, time_boot_ms) }, \
         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_attitude_body_t, roll) }, \
         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_attitude_body_t, pitch) }, \
         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_attitude_body_t, yaw) }, \
         { "roll_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_attitude_body_t, roll_speed) }, \
         { "pitch_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_attitude_body_t, pitch_speed) }, \
         { "yaw_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_attitude_body_t, yaw_speed) }, \
         { "roll_observed", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_attitude_body_t, roll_observed) }, \
         { "pitch_observed", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_attitude_body_t, pitch_observed) }, \
         { "yaw_observed_mag", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_attitude_body_t, yaw_observed_mag) }, \
         { "yaw_observed_rtk", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_attitude_body_t, yaw_observed_rtk) }, \
         { "roll_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_attitude_body_t, roll_obs_sub_pred) }, \
         { "pitch_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_attitude_body_t, pitch_obs_sub_pred) }, \
         { "yaw_obs_sub_pred", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_attitude_body_t, yaw_obs_sub_pred) }, \
         { "gyro_x_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_attitude_body_t, gyro_x_bia) }, \
         { "gyro_y_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_attitude_body_t, gyro_y_bia) }, \
         { "gyro_z_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_attitude_body_t, gyro_z_bia) }, \
         { "ba_x", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_attitude_body_t, ba_x) }, \
         { "ba_y", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_attitude_body_t, ba_y) }, \
         { "ba_z", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_attitude_body_t, ba_z) }, \
         { "ba_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 84, offsetof(mavlink_attitude_body_t, ba_x_obs) }, \
         { "ba_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 88, offsetof(mavlink_attitude_body_t, ba_y_obs) }, \
         { "ba_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 92, offsetof(mavlink_attitude_body_t, ba_z_obs) }, \
         { "ba_x_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 96, offsetof(mavlink_attitude_body_t, ba_x_bia) }, \
         { "ba_y_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 100, offsetof(mavlink_attitude_body_t, ba_y_bia) }, \
         { "ba_z_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 104, offsetof(mavlink_attitude_body_t, ba_z_bia) }, \
         { "bm_x", NULL, MAVLINK_TYPE_FLOAT, 0, 108, offsetof(mavlink_attitude_body_t, bm_x) }, \
         { "bm_y", NULL, MAVLINK_TYPE_FLOAT, 0, 112, offsetof(mavlink_attitude_body_t, bm_y) }, \
         { "bm_z", NULL, MAVLINK_TYPE_FLOAT, 0, 116, offsetof(mavlink_attitude_body_t, bm_z) }, \
         { "bm_x_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 120, offsetof(mavlink_attitude_body_t, bm_x_obs) }, \
         { "bm_y_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 124, offsetof(mavlink_attitude_body_t, bm_y_obs) }, \
         { "bm_z_obs", NULL, MAVLINK_TYPE_FLOAT, 0, 128, offsetof(mavlink_attitude_body_t, bm_z_obs) }, \
         { "bm_x_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 132, offsetof(mavlink_attitude_body_t, bm_x_bia) }, \
         { "bm_y_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 136, offsetof(mavlink_attitude_body_t, bm_y_bia) }, \
         { "bm_z_bia", NULL, MAVLINK_TYPE_FLOAT, 0, 140, offsetof(mavlink_attitude_body_t, bm_z_bia) }, \
         { "time_used", NULL, MAVLINK_TYPE_UINT32_T, 0, 144, offsetof(mavlink_attitude_body_t, time_used) }, \
         { "static_flag", NULL, MAVLINK_TYPE_UINT8_T, 0, 184, offsetof(mavlink_attitude_body_t, static_flag) }, \
         { "reserve1", NULL, MAVLINK_TYPE_FLOAT, 0, 148, offsetof(mavlink_attitude_body_t, reserve1) }, \
         { "reserve2", NULL, MAVLINK_TYPE_FLOAT, 0, 152, offsetof(mavlink_attitude_body_t, reserve2) }, \
         { "reserve3", NULL, MAVLINK_TYPE_FLOAT, 0, 156, offsetof(mavlink_attitude_body_t, reserve3) }, \
         { "reserve4", NULL, MAVLINK_TYPE_FLOAT, 0, 160, offsetof(mavlink_attitude_body_t, reserve4) }, \
         { "reserve5", NULL, MAVLINK_TYPE_FLOAT, 0, 164, offsetof(mavlink_attitude_body_t, reserve5) }, \
         { "reserve6", NULL, MAVLINK_TYPE_FLOAT, 0, 168, offsetof(mavlink_attitude_body_t, reserve6) }, \
         { "reserve7", NULL, MAVLINK_TYPE_FLOAT, 0, 172, offsetof(mavlink_attitude_body_t, reserve7) }, \
         { "reserve8", NULL, MAVLINK_TYPE_FLOAT, 0, 176, offsetof(mavlink_attitude_body_t, reserve8) }, \
         { "reserve9", NULL, MAVLINK_TYPE_FLOAT, 0, 180, offsetof(mavlink_attitude_body_t, reserve9) }, \
         } \
}
#endif

/**
 * @brief Pack a attitude_body message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param roll [rad] Roll angle (-pi..+pi)
 * @param pitch [rad] Pitch angle (-pi..+pi)
 * @param yaw [rad] Yaw angle (-pi..+pi)
 * @param roll_speed [rad/s] Roll angular speed
 * @param pitch_speed [rad/s] Pitch angular speed
 * @param yaw_speed [rad/s] Yaw angular speed
 * @param roll_observed [deg] Roll observed value (-180..180)
 * @param pitch_observed [deg] Pitch observed value (-90..90)
 * @param yaw_observed_mag [deg] Yaw observed value (-180..180)
 * @param yaw_observed_rtk [deg] Yaw observed value (-180..180)
 * @param roll_obs_sub_pred [deg]  Error between roll angle observed value and prediction value (-180..180)
 * @param pitch_obs_sub_pred [deg] Error between pitch angle observed value and prediction value (-90..90)
 * @param yaw_obs_sub_pred [deg]  Error between yaw angle observed value and prediction value (-180..180)
 * @param gyro_x_bia [deg] X axis gyroscope bias value in body frame (-180..180)
 * @param gyro_y_bia [deg] Y axis gyroscope bias value in body frame (-180..180)
 * @param gyro_z_bia [deg] Z axis gyroscope bias value in body frame (-180..180)
 * @param ba_x [deg/s/s] x axis acceleration value in body frame (-180..180)
 * @param ba_y [deg/s/s] y axis acceleration value in body frame (-180..180)
 * @param ba_z [deg/s/s] z axis acceleration value in body frame (-180..180)
 * @param ba_x_obs [deg/s/s] x axis acceleration observe value in body frame (-180..180)
 * @param ba_y_obs [deg/s/s] y axis acceleration observe value in body frame (-180..180)
 * @param ba_z_obs [deg/s/s] z axis acceleration observe value in body frame (-180..180)
 * @param ba_x_bia [deg/s/s] X axis acceleration bias value in body frame (-30..30)
 * @param ba_y_bia [deg/s/s] Y axis acceleration bias value in body frame (-30..30)
 * @param ba_z_bia [deg/s/s] Z axis acceleration bias value in body frame (-30..30)
 * @param bm_x [mgauss] x axis mgauss value in body frame (-1000..1000)
 * @param bm_y [mgauss] y axis mgauss value in body frame (-1000..1000)
 * @param bm_z [mgauss] z axis mgauss value in body frame (-1000..1000)
 * @param bm_x_obs [mgauss] x axis mgauss observe value in body frame (-1000..1000)
 * @param bm_y_obs [mgauss] y axis mgauss observe value in body frame (-1000..1000)
 * @param bm_z_obs [mgauss] z axis mgauss observe value in body frame (-1000..1000)
 * @param bm_x_bia [mgauss] X axis magnetometer bias value in body frame (-1000..1000)
 * @param bm_y_bia [mgauss] Y axis magnetometer bias value in body frame (-1000..1000)
 * @param bm_z_bia [mgauss] Z axis magnetometer bias value in body frame (-1000..1000)
 * @param time_used  fusion time
 * @param static_flag  Flag of body state. 0:body is moving 1:body is static
 * @param reserve1  reserve1
 * @param reserve2  reserve2
 * @param reserve3  reserve3
 * @param reserve4  reserve4
 * @param reserve5  reserve5
 * @param reserve6  reserve6
 * @param reserve7  reserve7
 * @param reserve8  reserve8
 * @param reserve9  reserve9
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_attitude_body_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint64_t time_boot_ms, float roll, float pitch, float yaw, float roll_speed, float pitch_speed, float yaw_speed, float roll_observed, float pitch_observed, float yaw_observed_mag, float yaw_observed_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float gyro_x_bia, float gyro_y_bia, float gyro_z_bia, float ba_x, float ba_y, float ba_z, float ba_x_obs, float ba_y_obs, float ba_z_obs, float ba_x_bia, float ba_y_bia, float ba_z_bia, float bm_x, float bm_y, float bm_z, float bm_x_obs, float bm_y_obs, float bm_z_obs, float bm_x_bia, float bm_y_bia, float bm_z_bia, uint32_t time_used, uint8_t static_flag, float reserve1, float reserve2, float reserve3, float reserve4, float reserve5, float reserve6, float reserve7, float reserve8, float reserve9)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BODY_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, roll);
    _mav_put_float(buf, 12, pitch);
    _mav_put_float(buf, 16, yaw);
    _mav_put_float(buf, 20, roll_speed);
    _mav_put_float(buf, 24, pitch_speed);
    _mav_put_float(buf, 28, yaw_speed);
    _mav_put_float(buf, 32, roll_observed);
    _mav_put_float(buf, 36, pitch_observed);
    _mav_put_float(buf, 40, yaw_observed_mag);
    _mav_put_float(buf, 44, yaw_observed_rtk);
    _mav_put_float(buf, 48, roll_obs_sub_pred);
    _mav_put_float(buf, 52, pitch_obs_sub_pred);
    _mav_put_float(buf, 56, yaw_obs_sub_pred);
    _mav_put_float(buf, 60, gyro_x_bia);
    _mav_put_float(buf, 64, gyro_y_bia);
    _mav_put_float(buf, 68, gyro_z_bia);
    _mav_put_float(buf, 72, ba_x);
    _mav_put_float(buf, 76, ba_y);
    _mav_put_float(buf, 80, ba_z);
    _mav_put_float(buf, 84, ba_x_obs);
    _mav_put_float(buf, 88, ba_y_obs);
    _mav_put_float(buf, 92, ba_z_obs);
    _mav_put_float(buf, 96, ba_x_bia);
    _mav_put_float(buf, 100, ba_y_bia);
    _mav_put_float(buf, 104, ba_z_bia);
    _mav_put_float(buf, 108, bm_x);
    _mav_put_float(buf, 112, bm_y);
    _mav_put_float(buf, 116, bm_z);
    _mav_put_float(buf, 120, bm_x_obs);
    _mav_put_float(buf, 124, bm_y_obs);
    _mav_put_float(buf, 128, bm_z_obs);
    _mav_put_float(buf, 132, bm_x_bia);
    _mav_put_float(buf, 136, bm_y_bia);
    _mav_put_float(buf, 140, bm_z_bia);
    _mav_put_uint32_t(buf, 144, time_used);
    _mav_put_float(buf, 148, reserve1);
    _mav_put_float(buf, 152, reserve2);
    _mav_put_float(buf, 156, reserve3);
    _mav_put_float(buf, 160, reserve4);
    _mav_put_float(buf, 164, reserve5);
    _mav_put_float(buf, 168, reserve6);
    _mav_put_float(buf, 172, reserve7);
    _mav_put_float(buf, 176, reserve8);
    _mav_put_float(buf, 180, reserve9);
    _mav_put_uint8_t(buf, 184, static_flag);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN);
#else
    mavlink_attitude_body_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.roll = roll;
    packet.pitch = pitch;
    packet.yaw = yaw;
    packet.roll_speed = roll_speed;
    packet.pitch_speed = pitch_speed;
    packet.yaw_speed = yaw_speed;
    packet.roll_observed = roll_observed;
    packet.pitch_observed = pitch_observed;
    packet.yaw_observed_mag = yaw_observed_mag;
    packet.yaw_observed_rtk = yaw_observed_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.gyro_x_bia = gyro_x_bia;
    packet.gyro_y_bia = gyro_y_bia;
    packet.gyro_z_bia = gyro_z_bia;
    packet.ba_x = ba_x;
    packet.ba_y = ba_y;
    packet.ba_z = ba_z;
    packet.ba_x_obs = ba_x_obs;
    packet.ba_y_obs = ba_y_obs;
    packet.ba_z_obs = ba_z_obs;
    packet.ba_x_bia = ba_x_bia;
    packet.ba_y_bia = ba_y_bia;
    packet.ba_z_bia = ba_z_bia;
    packet.bm_x = bm_x;
    packet.bm_y = bm_y;
    packet.bm_z = bm_z;
    packet.bm_x_obs = bm_x_obs;
    packet.bm_y_obs = bm_y_obs;
    packet.bm_z_obs = bm_z_obs;
    packet.bm_x_bia = bm_x_bia;
    packet.bm_y_bia = bm_y_bia;
    packet.bm_z_bia = bm_z_bia;
    packet.time_used = time_used;
    packet.reserve1 = reserve1;
    packet.reserve2 = reserve2;
    packet.reserve3 = reserve3;
    packet.reserve4 = reserve4;
    packet.reserve5 = reserve5;
    packet.reserve6 = reserve6;
    packet.reserve7 = reserve7;
    packet.reserve8 = reserve8;
    packet.reserve9 = reserve9;
    packet.static_flag = static_flag;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATTITUDE_BODY;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_CRC);
}

/**
 * @brief Pack a attitude_body message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param roll [rad] Roll angle (-pi..+pi)
 * @param pitch [rad] Pitch angle (-pi..+pi)
 * @param yaw [rad] Yaw angle (-pi..+pi)
 * @param roll_speed [rad/s] Roll angular speed
 * @param pitch_speed [rad/s] Pitch angular speed
 * @param yaw_speed [rad/s] Yaw angular speed
 * @param roll_observed [deg] Roll observed value (-180..180)
 * @param pitch_observed [deg] Pitch observed value (-90..90)
 * @param yaw_observed_mag [deg] Yaw observed value (-180..180)
 * @param yaw_observed_rtk [deg] Yaw observed value (-180..180)
 * @param roll_obs_sub_pred [deg]  Error between roll angle observed value and prediction value (-180..180)
 * @param pitch_obs_sub_pred [deg] Error between pitch angle observed value and prediction value (-90..90)
 * @param yaw_obs_sub_pred [deg]  Error between yaw angle observed value and prediction value (-180..180)
 * @param gyro_x_bia [deg] X axis gyroscope bias value in body frame (-180..180)
 * @param gyro_y_bia [deg] Y axis gyroscope bias value in body frame (-180..180)
 * @param gyro_z_bia [deg] Z axis gyroscope bias value in body frame (-180..180)
 * @param ba_x [deg/s/s] x axis acceleration value in body frame (-180..180)
 * @param ba_y [deg/s/s] y axis acceleration value in body frame (-180..180)
 * @param ba_z [deg/s/s] z axis acceleration value in body frame (-180..180)
 * @param ba_x_obs [deg/s/s] x axis acceleration observe value in body frame (-180..180)
 * @param ba_y_obs [deg/s/s] y axis acceleration observe value in body frame (-180..180)
 * @param ba_z_obs [deg/s/s] z axis acceleration observe value in body frame (-180..180)
 * @param ba_x_bia [deg/s/s] X axis acceleration bias value in body frame (-30..30)
 * @param ba_y_bia [deg/s/s] Y axis acceleration bias value in body frame (-30..30)
 * @param ba_z_bia [deg/s/s] Z axis acceleration bias value in body frame (-30..30)
 * @param bm_x [mgauss] x axis mgauss value in body frame (-1000..1000)
 * @param bm_y [mgauss] y axis mgauss value in body frame (-1000..1000)
 * @param bm_z [mgauss] z axis mgauss value in body frame (-1000..1000)
 * @param bm_x_obs [mgauss] x axis mgauss observe value in body frame (-1000..1000)
 * @param bm_y_obs [mgauss] y axis mgauss observe value in body frame (-1000..1000)
 * @param bm_z_obs [mgauss] z axis mgauss observe value in body frame (-1000..1000)
 * @param bm_x_bia [mgauss] X axis magnetometer bias value in body frame (-1000..1000)
 * @param bm_y_bia [mgauss] Y axis magnetometer bias value in body frame (-1000..1000)
 * @param bm_z_bia [mgauss] Z axis magnetometer bias value in body frame (-1000..1000)
 * @param time_used  fusion time
 * @param static_flag  Flag of body state. 0:body is moving 1:body is static
 * @param reserve1  reserve1
 * @param reserve2  reserve2
 * @param reserve3  reserve3
 * @param reserve4  reserve4
 * @param reserve5  reserve5
 * @param reserve6  reserve6
 * @param reserve7  reserve7
 * @param reserve8  reserve8
 * @param reserve9  reserve9
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_attitude_body_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint64_t time_boot_ms,float roll,float pitch,float yaw,float roll_speed,float pitch_speed,float yaw_speed,float roll_observed,float pitch_observed,float yaw_observed_mag,float yaw_observed_rtk,float roll_obs_sub_pred,float pitch_obs_sub_pred,float yaw_obs_sub_pred,float gyro_x_bia,float gyro_y_bia,float gyro_z_bia,float ba_x,float ba_y,float ba_z,float ba_x_obs,float ba_y_obs,float ba_z_obs,float ba_x_bia,float ba_y_bia,float ba_z_bia,float bm_x,float bm_y,float bm_z,float bm_x_obs,float bm_y_obs,float bm_z_obs,float bm_x_bia,float bm_y_bia,float bm_z_bia,uint32_t time_used,uint8_t static_flag,float reserve1,float reserve2,float reserve3,float reserve4,float reserve5,float reserve6,float reserve7,float reserve8,float reserve9)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BODY_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, roll);
    _mav_put_float(buf, 12, pitch);
    _mav_put_float(buf, 16, yaw);
    _mav_put_float(buf, 20, roll_speed);
    _mav_put_float(buf, 24, pitch_speed);
    _mav_put_float(buf, 28, yaw_speed);
    _mav_put_float(buf, 32, roll_observed);
    _mav_put_float(buf, 36, pitch_observed);
    _mav_put_float(buf, 40, yaw_observed_mag);
    _mav_put_float(buf, 44, yaw_observed_rtk);
    _mav_put_float(buf, 48, roll_obs_sub_pred);
    _mav_put_float(buf, 52, pitch_obs_sub_pred);
    _mav_put_float(buf, 56, yaw_obs_sub_pred);
    _mav_put_float(buf, 60, gyro_x_bia);
    _mav_put_float(buf, 64, gyro_y_bia);
    _mav_put_float(buf, 68, gyro_z_bia);
    _mav_put_float(buf, 72, ba_x);
    _mav_put_float(buf, 76, ba_y);
    _mav_put_float(buf, 80, ba_z);
    _mav_put_float(buf, 84, ba_x_obs);
    _mav_put_float(buf, 88, ba_y_obs);
    _mav_put_float(buf, 92, ba_z_obs);
    _mav_put_float(buf, 96, ba_x_bia);
    _mav_put_float(buf, 100, ba_y_bia);
    _mav_put_float(buf, 104, ba_z_bia);
    _mav_put_float(buf, 108, bm_x);
    _mav_put_float(buf, 112, bm_y);
    _mav_put_float(buf, 116, bm_z);
    _mav_put_float(buf, 120, bm_x_obs);
    _mav_put_float(buf, 124, bm_y_obs);
    _mav_put_float(buf, 128, bm_z_obs);
    _mav_put_float(buf, 132, bm_x_bia);
    _mav_put_float(buf, 136, bm_y_bia);
    _mav_put_float(buf, 140, bm_z_bia);
    _mav_put_uint32_t(buf, 144, time_used);
    _mav_put_float(buf, 148, reserve1);
    _mav_put_float(buf, 152, reserve2);
    _mav_put_float(buf, 156, reserve3);
    _mav_put_float(buf, 160, reserve4);
    _mav_put_float(buf, 164, reserve5);
    _mav_put_float(buf, 168, reserve6);
    _mav_put_float(buf, 172, reserve7);
    _mav_put_float(buf, 176, reserve8);
    _mav_put_float(buf, 180, reserve9);
    _mav_put_uint8_t(buf, 184, static_flag);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN);
#else
    mavlink_attitude_body_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.roll = roll;
    packet.pitch = pitch;
    packet.yaw = yaw;
    packet.roll_speed = roll_speed;
    packet.pitch_speed = pitch_speed;
    packet.yaw_speed = yaw_speed;
    packet.roll_observed = roll_observed;
    packet.pitch_observed = pitch_observed;
    packet.yaw_observed_mag = yaw_observed_mag;
    packet.yaw_observed_rtk = yaw_observed_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.gyro_x_bia = gyro_x_bia;
    packet.gyro_y_bia = gyro_y_bia;
    packet.gyro_z_bia = gyro_z_bia;
    packet.ba_x = ba_x;
    packet.ba_y = ba_y;
    packet.ba_z = ba_z;
    packet.ba_x_obs = ba_x_obs;
    packet.ba_y_obs = ba_y_obs;
    packet.ba_z_obs = ba_z_obs;
    packet.ba_x_bia = ba_x_bia;
    packet.ba_y_bia = ba_y_bia;
    packet.ba_z_bia = ba_z_bia;
    packet.bm_x = bm_x;
    packet.bm_y = bm_y;
    packet.bm_z = bm_z;
    packet.bm_x_obs = bm_x_obs;
    packet.bm_y_obs = bm_y_obs;
    packet.bm_z_obs = bm_z_obs;
    packet.bm_x_bia = bm_x_bia;
    packet.bm_y_bia = bm_y_bia;
    packet.bm_z_bia = bm_z_bia;
    packet.time_used = time_used;
    packet.reserve1 = reserve1;
    packet.reserve2 = reserve2;
    packet.reserve3 = reserve3;
    packet.reserve4 = reserve4;
    packet.reserve5 = reserve5;
    packet.reserve6 = reserve6;
    packet.reserve7 = reserve7;
    packet.reserve8 = reserve8;
    packet.reserve9 = reserve9;
    packet.static_flag = static_flag;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_ATTITUDE_BODY;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_CRC);
}

/**
 * @brief Encode a attitude_body struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param attitude_body C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_attitude_body_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_attitude_body_t* attitude_body)
{
    return mavlink_msg_attitude_body_pack(system_id, component_id, msg, attitude_body->time_boot_ms, attitude_body->roll, attitude_body->pitch, attitude_body->yaw, attitude_body->roll_speed, attitude_body->pitch_speed, attitude_body->yaw_speed, attitude_body->roll_observed, attitude_body->pitch_observed, attitude_body->yaw_observed_mag, attitude_body->yaw_observed_rtk, attitude_body->roll_obs_sub_pred, attitude_body->pitch_obs_sub_pred, attitude_body->yaw_obs_sub_pred, attitude_body->gyro_x_bia, attitude_body->gyro_y_bia, attitude_body->gyro_z_bia, attitude_body->ba_x, attitude_body->ba_y, attitude_body->ba_z, attitude_body->ba_x_obs, attitude_body->ba_y_obs, attitude_body->ba_z_obs, attitude_body->ba_x_bia, attitude_body->ba_y_bia, attitude_body->ba_z_bia, attitude_body->bm_x, attitude_body->bm_y, attitude_body->bm_z, attitude_body->bm_x_obs, attitude_body->bm_y_obs, attitude_body->bm_z_obs, attitude_body->bm_x_bia, attitude_body->bm_y_bia, attitude_body->bm_z_bia, attitude_body->time_used, attitude_body->static_flag, attitude_body->reserve1, attitude_body->reserve2, attitude_body->reserve3, attitude_body->reserve4, attitude_body->reserve5, attitude_body->reserve6, attitude_body->reserve7, attitude_body->reserve8, attitude_body->reserve9);
}

/**
 * @brief Encode a attitude_body struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param attitude_body C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_attitude_body_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_attitude_body_t* attitude_body)
{
    return mavlink_msg_attitude_body_pack_chan(system_id, component_id, chan, msg, attitude_body->time_boot_ms, attitude_body->roll, attitude_body->pitch, attitude_body->yaw, attitude_body->roll_speed, attitude_body->pitch_speed, attitude_body->yaw_speed, attitude_body->roll_observed, attitude_body->pitch_observed, attitude_body->yaw_observed_mag, attitude_body->yaw_observed_rtk, attitude_body->roll_obs_sub_pred, attitude_body->pitch_obs_sub_pred, attitude_body->yaw_obs_sub_pred, attitude_body->gyro_x_bia, attitude_body->gyro_y_bia, attitude_body->gyro_z_bia, attitude_body->ba_x, attitude_body->ba_y, attitude_body->ba_z, attitude_body->ba_x_obs, attitude_body->ba_y_obs, attitude_body->ba_z_obs, attitude_body->ba_x_bia, attitude_body->ba_y_bia, attitude_body->ba_z_bia, attitude_body->bm_x, attitude_body->bm_y, attitude_body->bm_z, attitude_body->bm_x_obs, attitude_body->bm_y_obs, attitude_body->bm_z_obs, attitude_body->bm_x_bia, attitude_body->bm_y_bia, attitude_body->bm_z_bia, attitude_body->time_used, attitude_body->static_flag, attitude_body->reserve1, attitude_body->reserve2, attitude_body->reserve3, attitude_body->reserve4, attitude_body->reserve5, attitude_body->reserve6, attitude_body->reserve7, attitude_body->reserve8, attitude_body->reserve9);
}

/**
 * @brief Send a attitude_body message
 * @param chan MAVLink channel to send the message
 *
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param roll [rad] Roll angle (-pi..+pi)
 * @param pitch [rad] Pitch angle (-pi..+pi)
 * @param yaw [rad] Yaw angle (-pi..+pi)
 * @param roll_speed [rad/s] Roll angular speed
 * @param pitch_speed [rad/s] Pitch angular speed
 * @param yaw_speed [rad/s] Yaw angular speed
 * @param roll_observed [deg] Roll observed value (-180..180)
 * @param pitch_observed [deg] Pitch observed value (-90..90)
 * @param yaw_observed_mag [deg] Yaw observed value (-180..180)
 * @param yaw_observed_rtk [deg] Yaw observed value (-180..180)
 * @param roll_obs_sub_pred [deg]  Error between roll angle observed value and prediction value (-180..180)
 * @param pitch_obs_sub_pred [deg] Error between pitch angle observed value and prediction value (-90..90)
 * @param yaw_obs_sub_pred [deg]  Error between yaw angle observed value and prediction value (-180..180)
 * @param gyro_x_bia [deg] X axis gyroscope bias value in body frame (-180..180)
 * @param gyro_y_bia [deg] Y axis gyroscope bias value in body frame (-180..180)
 * @param gyro_z_bia [deg] Z axis gyroscope bias value in body frame (-180..180)
 * @param ba_x [deg/s/s] x axis acceleration value in body frame (-180..180)
 * @param ba_y [deg/s/s] y axis acceleration value in body frame (-180..180)
 * @param ba_z [deg/s/s] z axis acceleration value in body frame (-180..180)
 * @param ba_x_obs [deg/s/s] x axis acceleration observe value in body frame (-180..180)
 * @param ba_y_obs [deg/s/s] y axis acceleration observe value in body frame (-180..180)
 * @param ba_z_obs [deg/s/s] z axis acceleration observe value in body frame (-180..180)
 * @param ba_x_bia [deg/s/s] X axis acceleration bias value in body frame (-30..30)
 * @param ba_y_bia [deg/s/s] Y axis acceleration bias value in body frame (-30..30)
 * @param ba_z_bia [deg/s/s] Z axis acceleration bias value in body frame (-30..30)
 * @param bm_x [mgauss] x axis mgauss value in body frame (-1000..1000)
 * @param bm_y [mgauss] y axis mgauss value in body frame (-1000..1000)
 * @param bm_z [mgauss] z axis mgauss value in body frame (-1000..1000)
 * @param bm_x_obs [mgauss] x axis mgauss observe value in body frame (-1000..1000)
 * @param bm_y_obs [mgauss] y axis mgauss observe value in body frame (-1000..1000)
 * @param bm_z_obs [mgauss] z axis mgauss observe value in body frame (-1000..1000)
 * @param bm_x_bia [mgauss] X axis magnetometer bias value in body frame (-1000..1000)
 * @param bm_y_bia [mgauss] Y axis magnetometer bias value in body frame (-1000..1000)
 * @param bm_z_bia [mgauss] Z axis magnetometer bias value in body frame (-1000..1000)
 * @param time_used  fusion time
 * @param static_flag  Flag of body state. 0:body is moving 1:body is static
 * @param reserve1  reserve1
 * @param reserve2  reserve2
 * @param reserve3  reserve3
 * @param reserve4  reserve4
 * @param reserve5  reserve5
 * @param reserve6  reserve6
 * @param reserve7  reserve7
 * @param reserve8  reserve8
 * @param reserve9  reserve9
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_attitude_body_send(mavlink_channel_t chan, uint64_t time_boot_ms, float roll, float pitch, float yaw, float roll_speed, float pitch_speed, float yaw_speed, float roll_observed, float pitch_observed, float yaw_observed_mag, float yaw_observed_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float gyro_x_bia, float gyro_y_bia, float gyro_z_bia, float ba_x, float ba_y, float ba_z, float ba_x_obs, float ba_y_obs, float ba_z_obs, float ba_x_bia, float ba_y_bia, float ba_z_bia, float bm_x, float bm_y, float bm_z, float bm_x_obs, float bm_y_obs, float bm_z_obs, float bm_x_bia, float bm_y_bia, float bm_z_bia, uint32_t time_used, uint8_t static_flag, float reserve1, float reserve2, float reserve3, float reserve4, float reserve5, float reserve6, float reserve7, float reserve8, float reserve9)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_ATTITUDE_BODY_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, roll);
    _mav_put_float(buf, 12, pitch);
    _mav_put_float(buf, 16, yaw);
    _mav_put_float(buf, 20, roll_speed);
    _mav_put_float(buf, 24, pitch_speed);
    _mav_put_float(buf, 28, yaw_speed);
    _mav_put_float(buf, 32, roll_observed);
    _mav_put_float(buf, 36, pitch_observed);
    _mav_put_float(buf, 40, yaw_observed_mag);
    _mav_put_float(buf, 44, yaw_observed_rtk);
    _mav_put_float(buf, 48, roll_obs_sub_pred);
    _mav_put_float(buf, 52, pitch_obs_sub_pred);
    _mav_put_float(buf, 56, yaw_obs_sub_pred);
    _mav_put_float(buf, 60, gyro_x_bia);
    _mav_put_float(buf, 64, gyro_y_bia);
    _mav_put_float(buf, 68, gyro_z_bia);
    _mav_put_float(buf, 72, ba_x);
    _mav_put_float(buf, 76, ba_y);
    _mav_put_float(buf, 80, ba_z);
    _mav_put_float(buf, 84, ba_x_obs);
    _mav_put_float(buf, 88, ba_y_obs);
    _mav_put_float(buf, 92, ba_z_obs);
    _mav_put_float(buf, 96, ba_x_bia);
    _mav_put_float(buf, 100, ba_y_bia);
    _mav_put_float(buf, 104, ba_z_bia);
    _mav_put_float(buf, 108, bm_x);
    _mav_put_float(buf, 112, bm_y);
    _mav_put_float(buf, 116, bm_z);
    _mav_put_float(buf, 120, bm_x_obs);
    _mav_put_float(buf, 124, bm_y_obs);
    _mav_put_float(buf, 128, bm_z_obs);
    _mav_put_float(buf, 132, bm_x_bia);
    _mav_put_float(buf, 136, bm_y_bia);
    _mav_put_float(buf, 140, bm_z_bia);
    _mav_put_uint32_t(buf, 144, time_used);
    _mav_put_float(buf, 148, reserve1);
    _mav_put_float(buf, 152, reserve2);
    _mav_put_float(buf, 156, reserve3);
    _mav_put_float(buf, 160, reserve4);
    _mav_put_float(buf, 164, reserve5);
    _mav_put_float(buf, 168, reserve6);
    _mav_put_float(buf, 172, reserve7);
    _mav_put_float(buf, 176, reserve8);
    _mav_put_float(buf, 180, reserve9);
    _mav_put_uint8_t(buf, 184, static_flag);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY, buf, MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_CRC);
#else
    mavlink_attitude_body_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.roll = roll;
    packet.pitch = pitch;
    packet.yaw = yaw;
    packet.roll_speed = roll_speed;
    packet.pitch_speed = pitch_speed;
    packet.yaw_speed = yaw_speed;
    packet.roll_observed = roll_observed;
    packet.pitch_observed = pitch_observed;
    packet.yaw_observed_mag = yaw_observed_mag;
    packet.yaw_observed_rtk = yaw_observed_rtk;
    packet.roll_obs_sub_pred = roll_obs_sub_pred;
    packet.pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet.yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet.gyro_x_bia = gyro_x_bia;
    packet.gyro_y_bia = gyro_y_bia;
    packet.gyro_z_bia = gyro_z_bia;
    packet.ba_x = ba_x;
    packet.ba_y = ba_y;
    packet.ba_z = ba_z;
    packet.ba_x_obs = ba_x_obs;
    packet.ba_y_obs = ba_y_obs;
    packet.ba_z_obs = ba_z_obs;
    packet.ba_x_bia = ba_x_bia;
    packet.ba_y_bia = ba_y_bia;
    packet.ba_z_bia = ba_z_bia;
    packet.bm_x = bm_x;
    packet.bm_y = bm_y;
    packet.bm_z = bm_z;
    packet.bm_x_obs = bm_x_obs;
    packet.bm_y_obs = bm_y_obs;
    packet.bm_z_obs = bm_z_obs;
    packet.bm_x_bia = bm_x_bia;
    packet.bm_y_bia = bm_y_bia;
    packet.bm_z_bia = bm_z_bia;
    packet.time_used = time_used;
    packet.reserve1 = reserve1;
    packet.reserve2 = reserve2;
    packet.reserve3 = reserve3;
    packet.reserve4 = reserve4;
    packet.reserve5 = reserve5;
    packet.reserve6 = reserve6;
    packet.reserve7 = reserve7;
    packet.reserve8 = reserve8;
    packet.reserve9 = reserve9;
    packet.static_flag = static_flag;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY, (const char *)&packet, MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_CRC);
#endif
}

/**
 * @brief Send a attitude_body message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_attitude_body_send_struct(mavlink_channel_t chan, const mavlink_attitude_body_t* attitude_body)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_attitude_body_send(chan, attitude_body->time_boot_ms, attitude_body->roll, attitude_body->pitch, attitude_body->yaw, attitude_body->roll_speed, attitude_body->pitch_speed, attitude_body->yaw_speed, attitude_body->roll_observed, attitude_body->pitch_observed, attitude_body->yaw_observed_mag, attitude_body->yaw_observed_rtk, attitude_body->roll_obs_sub_pred, attitude_body->pitch_obs_sub_pred, attitude_body->yaw_obs_sub_pred, attitude_body->gyro_x_bia, attitude_body->gyro_y_bia, attitude_body->gyro_z_bia, attitude_body->ba_x, attitude_body->ba_y, attitude_body->ba_z, attitude_body->ba_x_obs, attitude_body->ba_y_obs, attitude_body->ba_z_obs, attitude_body->ba_x_bia, attitude_body->ba_y_bia, attitude_body->ba_z_bia, attitude_body->bm_x, attitude_body->bm_y, attitude_body->bm_z, attitude_body->bm_x_obs, attitude_body->bm_y_obs, attitude_body->bm_z_obs, attitude_body->bm_x_bia, attitude_body->bm_y_bia, attitude_body->bm_z_bia, attitude_body->time_used, attitude_body->static_flag, attitude_body->reserve1, attitude_body->reserve2, attitude_body->reserve3, attitude_body->reserve4, attitude_body->reserve5, attitude_body->reserve6, attitude_body->reserve7, attitude_body->reserve8, attitude_body->reserve9);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY, (const char *)attitude_body, MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_CRC);
#endif
}

#if MAVLINK_MSG_ID_ATTITUDE_BODY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_attitude_body_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_boot_ms, float roll, float pitch, float yaw, float roll_speed, float pitch_speed, float yaw_speed, float roll_observed, float pitch_observed, float yaw_observed_mag, float yaw_observed_rtk, float roll_obs_sub_pred, float pitch_obs_sub_pred, float yaw_obs_sub_pred, float gyro_x_bia, float gyro_y_bia, float gyro_z_bia, float ba_x, float ba_y, float ba_z, float ba_x_obs, float ba_y_obs, float ba_z_obs, float ba_x_bia, float ba_y_bia, float ba_z_bia, float bm_x, float bm_y, float bm_z, float bm_x_obs, float bm_y_obs, float bm_z_obs, float bm_x_bia, float bm_y_bia, float bm_z_bia, uint32_t time_used, uint8_t static_flag, float reserve1, float reserve2, float reserve3, float reserve4, float reserve5, float reserve6, float reserve7, float reserve8, float reserve9)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, roll);
    _mav_put_float(buf, 12, pitch);
    _mav_put_float(buf, 16, yaw);
    _mav_put_float(buf, 20, roll_speed);
    _mav_put_float(buf, 24, pitch_speed);
    _mav_put_float(buf, 28, yaw_speed);
    _mav_put_float(buf, 32, roll_observed);
    _mav_put_float(buf, 36, pitch_observed);
    _mav_put_float(buf, 40, yaw_observed_mag);
    _mav_put_float(buf, 44, yaw_observed_rtk);
    _mav_put_float(buf, 48, roll_obs_sub_pred);
    _mav_put_float(buf, 52, pitch_obs_sub_pred);
    _mav_put_float(buf, 56, yaw_obs_sub_pred);
    _mav_put_float(buf, 60, gyro_x_bia);
    _mav_put_float(buf, 64, gyro_y_bia);
    _mav_put_float(buf, 68, gyro_z_bia);
    _mav_put_float(buf, 72, ba_x);
    _mav_put_float(buf, 76, ba_y);
    _mav_put_float(buf, 80, ba_z);
    _mav_put_float(buf, 84, ba_x_obs);
    _mav_put_float(buf, 88, ba_y_obs);
    _mav_put_float(buf, 92, ba_z_obs);
    _mav_put_float(buf, 96, ba_x_bia);
    _mav_put_float(buf, 100, ba_y_bia);
    _mav_put_float(buf, 104, ba_z_bia);
    _mav_put_float(buf, 108, bm_x);
    _mav_put_float(buf, 112, bm_y);
    _mav_put_float(buf, 116, bm_z);
    _mav_put_float(buf, 120, bm_x_obs);
    _mav_put_float(buf, 124, bm_y_obs);
    _mav_put_float(buf, 128, bm_z_obs);
    _mav_put_float(buf, 132, bm_x_bia);
    _mav_put_float(buf, 136, bm_y_bia);
    _mav_put_float(buf, 140, bm_z_bia);
    _mav_put_uint32_t(buf, 144, time_used);
    _mav_put_float(buf, 148, reserve1);
    _mav_put_float(buf, 152, reserve2);
    _mav_put_float(buf, 156, reserve3);
    _mav_put_float(buf, 160, reserve4);
    _mav_put_float(buf, 164, reserve5);
    _mav_put_float(buf, 168, reserve6);
    _mav_put_float(buf, 172, reserve7);
    _mav_put_float(buf, 176, reserve8);
    _mav_put_float(buf, 180, reserve9);
    _mav_put_uint8_t(buf, 184, static_flag);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY, buf, MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_CRC);
#else
    mavlink_attitude_body_t *packet = (mavlink_attitude_body_t *)msgbuf;
    packet->time_boot_ms = time_boot_ms;
    packet->roll = roll;
    packet->pitch = pitch;
    packet->yaw = yaw;
    packet->roll_speed = roll_speed;
    packet->pitch_speed = pitch_speed;
    packet->yaw_speed = yaw_speed;
    packet->roll_observed = roll_observed;
    packet->pitch_observed = pitch_observed;
    packet->yaw_observed_mag = yaw_observed_mag;
    packet->yaw_observed_rtk = yaw_observed_rtk;
    packet->roll_obs_sub_pred = roll_obs_sub_pred;
    packet->pitch_obs_sub_pred = pitch_obs_sub_pred;
    packet->yaw_obs_sub_pred = yaw_obs_sub_pred;
    packet->gyro_x_bia = gyro_x_bia;
    packet->gyro_y_bia = gyro_y_bia;
    packet->gyro_z_bia = gyro_z_bia;
    packet->ba_x = ba_x;
    packet->ba_y = ba_y;
    packet->ba_z = ba_z;
    packet->ba_x_obs = ba_x_obs;
    packet->ba_y_obs = ba_y_obs;
    packet->ba_z_obs = ba_z_obs;
    packet->ba_x_bia = ba_x_bia;
    packet->ba_y_bia = ba_y_bia;
    packet->ba_z_bia = ba_z_bia;
    packet->bm_x = bm_x;
    packet->bm_y = bm_y;
    packet->bm_z = bm_z;
    packet->bm_x_obs = bm_x_obs;
    packet->bm_y_obs = bm_y_obs;
    packet->bm_z_obs = bm_z_obs;
    packet->bm_x_bia = bm_x_bia;
    packet->bm_y_bia = bm_y_bia;
    packet->bm_z_bia = bm_z_bia;
    packet->time_used = time_used;
    packet->reserve1 = reserve1;
    packet->reserve2 = reserve2;
    packet->reserve3 = reserve3;
    packet->reserve4 = reserve4;
    packet->reserve5 = reserve5;
    packet->reserve6 = reserve6;
    packet->reserve7 = reserve7;
    packet->reserve8 = reserve8;
    packet->reserve9 = reserve9;
    packet->static_flag = static_flag;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ATTITUDE_BODY, (const char *)packet, MAVLINK_MSG_ID_ATTITUDE_BODY_MIN_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN, MAVLINK_MSG_ID_ATTITUDE_BODY_CRC);
#endif
}
#endif

#endif

// MESSAGE ATTITUDE_BODY UNPACKING


/**
 * @brief Get field time_boot_ms from attitude_body message
 *
 * @return [ms] Timestamp (time since system boot).
 */
static inline uint64_t mavlink_msg_attitude_body_get_time_boot_ms(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint64_t(msg,  0);
}

/**
 * @brief Get field roll from attitude_body message
 *
 * @return [rad] Roll angle (-pi..+pi)
 */
static inline float mavlink_msg_attitude_body_get_roll(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field pitch from attitude_body message
 *
 * @return [rad] Pitch angle (-pi..+pi)
 */
static inline float mavlink_msg_attitude_body_get_pitch(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field yaw from attitude_body message
 *
 * @return [rad] Yaw angle (-pi..+pi)
 */
static inline float mavlink_msg_attitude_body_get_yaw(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Get field roll_speed from attitude_body message
 *
 * @return [rad/s] Roll angular speed
 */
static inline float mavlink_msg_attitude_body_get_roll_speed(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  20);
}

/**
 * @brief Get field pitch_speed from attitude_body message
 *
 * @return [rad/s] Pitch angular speed
 */
static inline float mavlink_msg_attitude_body_get_pitch_speed(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  24);
}

/**
 * @brief Get field yaw_speed from attitude_body message
 *
 * @return [rad/s] Yaw angular speed
 */
static inline float mavlink_msg_attitude_body_get_yaw_speed(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  28);
}

/**
 * @brief Get field roll_observed from attitude_body message
 *
 * @return [deg] Roll observed value (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_roll_observed(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  32);
}

/**
 * @brief Get field pitch_observed from attitude_body message
 *
 * @return [deg] Pitch observed value (-90..90)
 */
static inline float mavlink_msg_attitude_body_get_pitch_observed(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  36);
}

/**
 * @brief Get field yaw_observed_mag from attitude_body message
 *
 * @return [deg] Yaw observed value (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_yaw_observed_mag(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  40);
}

/**
 * @brief Get field yaw_observed_rtk from attitude_body message
 *
 * @return [deg] Yaw observed value (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_yaw_observed_rtk(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  44);
}

/**
 * @brief Get field roll_obs_sub_pred from attitude_body message
 *
 * @return [deg]  Error between roll angle observed value and prediction value (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_roll_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  48);
}

/**
 * @brief Get field pitch_obs_sub_pred from attitude_body message
 *
 * @return [deg] Error between pitch angle observed value and prediction value (-90..90)
 */
static inline float mavlink_msg_attitude_body_get_pitch_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  52);
}

/**
 * @brief Get field yaw_obs_sub_pred from attitude_body message
 *
 * @return [deg]  Error between yaw angle observed value and prediction value (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_yaw_obs_sub_pred(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  56);
}

/**
 * @brief Get field gyro_x_bia from attitude_body message
 *
 * @return [deg] X axis gyroscope bias value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_gyro_x_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  60);
}

/**
 * @brief Get field gyro_y_bia from attitude_body message
 *
 * @return [deg] Y axis gyroscope bias value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_gyro_y_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  64);
}

/**
 * @brief Get field gyro_z_bia from attitude_body message
 *
 * @return [deg] Z axis gyroscope bias value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_gyro_z_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  68);
}

/**
 * @brief Get field ba_x from attitude_body message
 *
 * @return [deg/s/s] x axis acceleration value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_ba_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  72);
}

/**
 * @brief Get field ba_y from attitude_body message
 *
 * @return [deg/s/s] y axis acceleration value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_ba_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  76);
}

/**
 * @brief Get field ba_z from attitude_body message
 *
 * @return [deg/s/s] z axis acceleration value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_ba_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  80);
}

/**
 * @brief Get field ba_x_obs from attitude_body message
 *
 * @return [deg/s/s] x axis acceleration observe value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_ba_x_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  84);
}

/**
 * @brief Get field ba_y_obs from attitude_body message
 *
 * @return [deg/s/s] y axis acceleration observe value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_ba_y_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  88);
}

/**
 * @brief Get field ba_z_obs from attitude_body message
 *
 * @return [deg/s/s] z axis acceleration observe value in body frame (-180..180)
 */
static inline float mavlink_msg_attitude_body_get_ba_z_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  92);
}

/**
 * @brief Get field ba_x_bia from attitude_body message
 *
 * @return [deg/s/s] X axis acceleration bias value in body frame (-30..30)
 */
static inline float mavlink_msg_attitude_body_get_ba_x_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  96);
}

/**
 * @brief Get field ba_y_bia from attitude_body message
 *
 * @return [deg/s/s] Y axis acceleration bias value in body frame (-30..30)
 */
static inline float mavlink_msg_attitude_body_get_ba_y_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  100);
}

/**
 * @brief Get field ba_z_bia from attitude_body message
 *
 * @return [deg/s/s] Z axis acceleration bias value in body frame (-30..30)
 */
static inline float mavlink_msg_attitude_body_get_ba_z_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  104);
}

/**
 * @brief Get field bm_x from attitude_body message
 *
 * @return [mgauss] x axis mgauss value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  108);
}

/**
 * @brief Get field bm_y from attitude_body message
 *
 * @return [mgauss] y axis mgauss value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  112);
}

/**
 * @brief Get field bm_z from attitude_body message
 *
 * @return [mgauss] z axis mgauss value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_z(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  116);
}

/**
 * @brief Get field bm_x_obs from attitude_body message
 *
 * @return [mgauss] x axis mgauss observe value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_x_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  120);
}

/**
 * @brief Get field bm_y_obs from attitude_body message
 *
 * @return [mgauss] y axis mgauss observe value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_y_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  124);
}

/**
 * @brief Get field bm_z_obs from attitude_body message
 *
 * @return [mgauss] z axis mgauss observe value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_z_obs(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  128);
}

/**
 * @brief Get field bm_x_bia from attitude_body message
 *
 * @return [mgauss] X axis magnetometer bias value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_x_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  132);
}

/**
 * @brief Get field bm_y_bia from attitude_body message
 *
 * @return [mgauss] Y axis magnetometer bias value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_y_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  136);
}

/**
 * @brief Get field bm_z_bia from attitude_body message
 *
 * @return [mgauss] Z axis magnetometer bias value in body frame (-1000..1000)
 */
static inline float mavlink_msg_attitude_body_get_bm_z_bia(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  140);
}

/**
 * @brief Get field time_used from attitude_body message
 *
 * @return  fusion time
 */
static inline uint32_t mavlink_msg_attitude_body_get_time_used(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  144);
}

/**
 * @brief Get field static_flag from attitude_body message
 *
 * @return  Flag of body state. 0:body is moving 1:body is static
 */
static inline uint8_t mavlink_msg_attitude_body_get_static_flag(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  184);
}

/**
 * @brief Get field reserve1 from attitude_body message
 *
 * @return  reserve1
 */
static inline float mavlink_msg_attitude_body_get_reserve1(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  148);
}

/**
 * @brief Get field reserve2 from attitude_body message
 *
 * @return  reserve2
 */
static inline float mavlink_msg_attitude_body_get_reserve2(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  152);
}

/**
 * @brief Get field reserve3 from attitude_body message
 *
 * @return  reserve3
 */
static inline float mavlink_msg_attitude_body_get_reserve3(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  156);
}

/**
 * @brief Get field reserve4 from attitude_body message
 *
 * @return  reserve4
 */
static inline float mavlink_msg_attitude_body_get_reserve4(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  160);
}

/**
 * @brief Get field reserve5 from attitude_body message
 *
 * @return  reserve5
 */
static inline float mavlink_msg_attitude_body_get_reserve5(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  164);
}

/**
 * @brief Get field reserve6 from attitude_body message
 *
 * @return  reserve6
 */
static inline float mavlink_msg_attitude_body_get_reserve6(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  168);
}

/**
 * @brief Get field reserve7 from attitude_body message
 *
 * @return  reserve7
 */
static inline float mavlink_msg_attitude_body_get_reserve7(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  172);
}

/**
 * @brief Get field reserve8 from attitude_body message
 *
 * @return  reserve8
 */
static inline float mavlink_msg_attitude_body_get_reserve8(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  176);
}

/**
 * @brief Get field reserve9 from attitude_body message
 *
 * @return  reserve9
 */
static inline float mavlink_msg_attitude_body_get_reserve9(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  180);
}

/**
 * @brief Decode a attitude_body message into a struct
 *
 * @param msg The message to decode
 * @param attitude_body C-struct to decode the message contents into
 */
static inline void mavlink_msg_attitude_body_decode(const mavlink_message_t* msg, mavlink_attitude_body_t* attitude_body)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    attitude_body->time_boot_ms = mavlink_msg_attitude_body_get_time_boot_ms(msg);
    attitude_body->roll = mavlink_msg_attitude_body_get_roll(msg);
    attitude_body->pitch = mavlink_msg_attitude_body_get_pitch(msg);
    attitude_body->yaw = mavlink_msg_attitude_body_get_yaw(msg);
    attitude_body->roll_speed = mavlink_msg_attitude_body_get_roll_speed(msg);
    attitude_body->pitch_speed = mavlink_msg_attitude_body_get_pitch_speed(msg);
    attitude_body->yaw_speed = mavlink_msg_attitude_body_get_yaw_speed(msg);
    attitude_body->roll_observed = mavlink_msg_attitude_body_get_roll_observed(msg);
    attitude_body->pitch_observed = mavlink_msg_attitude_body_get_pitch_observed(msg);
    attitude_body->yaw_observed_mag = mavlink_msg_attitude_body_get_yaw_observed_mag(msg);
    attitude_body->yaw_observed_rtk = mavlink_msg_attitude_body_get_yaw_observed_rtk(msg);
    attitude_body->roll_obs_sub_pred = mavlink_msg_attitude_body_get_roll_obs_sub_pred(msg);
    attitude_body->pitch_obs_sub_pred = mavlink_msg_attitude_body_get_pitch_obs_sub_pred(msg);
    attitude_body->yaw_obs_sub_pred = mavlink_msg_attitude_body_get_yaw_obs_sub_pred(msg);
    attitude_body->gyro_x_bia = mavlink_msg_attitude_body_get_gyro_x_bia(msg);
    attitude_body->gyro_y_bia = mavlink_msg_attitude_body_get_gyro_y_bia(msg);
    attitude_body->gyro_z_bia = mavlink_msg_attitude_body_get_gyro_z_bia(msg);
    attitude_body->ba_x = mavlink_msg_attitude_body_get_ba_x(msg);
    attitude_body->ba_y = mavlink_msg_attitude_body_get_ba_y(msg);
    attitude_body->ba_z = mavlink_msg_attitude_body_get_ba_z(msg);
    attitude_body->ba_x_obs = mavlink_msg_attitude_body_get_ba_x_obs(msg);
    attitude_body->ba_y_obs = mavlink_msg_attitude_body_get_ba_y_obs(msg);
    attitude_body->ba_z_obs = mavlink_msg_attitude_body_get_ba_z_obs(msg);
    attitude_body->ba_x_bia = mavlink_msg_attitude_body_get_ba_x_bia(msg);
    attitude_body->ba_y_bia = mavlink_msg_attitude_body_get_ba_y_bia(msg);
    attitude_body->ba_z_bia = mavlink_msg_attitude_body_get_ba_z_bia(msg);
    attitude_body->bm_x = mavlink_msg_attitude_body_get_bm_x(msg);
    attitude_body->bm_y = mavlink_msg_attitude_body_get_bm_y(msg);
    attitude_body->bm_z = mavlink_msg_attitude_body_get_bm_z(msg);
    attitude_body->bm_x_obs = mavlink_msg_attitude_body_get_bm_x_obs(msg);
    attitude_body->bm_y_obs = mavlink_msg_attitude_body_get_bm_y_obs(msg);
    attitude_body->bm_z_obs = mavlink_msg_attitude_body_get_bm_z_obs(msg);
    attitude_body->bm_x_bia = mavlink_msg_attitude_body_get_bm_x_bia(msg);
    attitude_body->bm_y_bia = mavlink_msg_attitude_body_get_bm_y_bia(msg);
    attitude_body->bm_z_bia = mavlink_msg_attitude_body_get_bm_z_bia(msg);
    attitude_body->time_used = mavlink_msg_attitude_body_get_time_used(msg);
    attitude_body->reserve1 = mavlink_msg_attitude_body_get_reserve1(msg);
    attitude_body->reserve2 = mavlink_msg_attitude_body_get_reserve2(msg);
    attitude_body->reserve3 = mavlink_msg_attitude_body_get_reserve3(msg);
    attitude_body->reserve4 = mavlink_msg_attitude_body_get_reserve4(msg);
    attitude_body->reserve5 = mavlink_msg_attitude_body_get_reserve5(msg);
    attitude_body->reserve6 = mavlink_msg_attitude_body_get_reserve6(msg);
    attitude_body->reserve7 = mavlink_msg_attitude_body_get_reserve7(msg);
    attitude_body->reserve8 = mavlink_msg_attitude_body_get_reserve8(msg);
    attitude_body->reserve9 = mavlink_msg_attitude_body_get_reserve9(msg);
    attitude_body->static_flag = mavlink_msg_attitude_body_get_static_flag(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_ATTITUDE_BODY_LEN? msg->len : MAVLINK_MSG_ID_ATTITUDE_BODY_LEN;
        memset(attitude_body, 0, MAVLINK_MSG_ID_ATTITUDE_BODY_LEN);
    memcpy(attitude_body, _MAV_PAYLOAD(msg), len);
#endif
}
